/*
 * @Author: June
 * @Date: 2022-11-14 14:40:09
 * @LastEditors: June
 * @LastEditTime: 2023-10-23 11:07:36
 * @Description: 全局配置
 *
 */
import Vue from 'vue'

import Cookies from 'js-cookie'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import '@/assets/icon/iconfont.css'
import '@/assets/icon/iconfont.js'
import '@/styles/index.scss' // global css
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/permission' // permission control
import request from '@/utils/request'
import * as echarts from 'echarts'
import { mapGetters } from 'vuex'
import App from './App'
import router from './router'
import store from './store'
import './utils/directive'

import ButtonGroup from '@/components/buttonGroup'
Vue.prototype.$axios = request
Vue.prototype.$echarts = echarts // 挂载到Vue实例上面
// 全局 按钮组
Vue.component('buttonGroup', ButtonGroup)
Vue.use(ElementUI, { size: Cookies.get('size') || 'small' })

// 全局混入表格字段list
Vue.mixin({
  computed: {
    ...mapGetters(['fieldList','themeColor'])
  }
  // mounted(){
  //       const buttons = this.$el.querySelectorAll('.el-button--primary');
  //   buttons.forEach((button) => {
  //     // 给每个按钮添加一个类名
  //     button.classList.add('global-button-class');
  //   })
  // }
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
